const app = getApp();
Page({
  search: function (e) {
    console.log(e.detail);
    wx.redirectTo({
      url: '../Search/SearchList?&cat_name=&cat_id=0&keywords=' + e.detail.value,
    })
  },
    onLoad: function (options) {
      this.setData({
        class_on:{
          type:"true"
        }
      });


      var that = this;
      wx.request({
        url: app.apiDomain + "index.php?c=foods&a=category",
        method: 'get',
				header:{
					'Content-Type': 'application/json'
				},
        success: function (res) {
          that.setData({
            index: res.data.data,
            hidden:true
          });
        }
      });
    },
  onShareAppMessage: function () {
    var nickName = '';
    try {
      nickName = wx.getStorageSync('nickName');
    } catch (e) { }
    return {
      title: nickName + '向你推荐「食材搭配」了解食材的功效、营养及搭配宜忌',
      imageUrl: 'https://resource.160nurse.com/upload/miniprogram/foods.jpeg'
    }
  }  
})



